<template>
<view class="content">
  <view>
	<view class="toptable">
	  <view class="toptd">产品型号:<input v-model="form.chanpingxinghao" class="topinp"> </view>
	  <view class="toptd">生产单号:<input v-model="form.shengchandanhao" class="topinp"> </view>
	  <view class="toptd">生产线号:<input v-model="form.shengchanxianhao" class="topinp"> </view>
	  <view class="toptd">订单数量:<input v-model="form.dingdanshuliang" class="topinp"> </view>
	  <view class="toptd">上架时间:<input v-model="form.shangjiashijian" type="date" class="topinp"> </view>
	  <view class="toptd">老化数量:<input v-model="form.laohuashuliang" class="topinp"> </view>
	  <view class="toptd">室{{ "\u3000" }}{{ "\u3000" }}温:<input v-model="form.shiwen" class="topinp"> </view>
	  <view class="toptd topinp" />
	</view>
  </view>
  <view class="viewborder">
	<view>
	  <h3 style="text-align: left">一、产品配置:</h3>
	  <view class="toptable">
		<view class="toptd"><checkbox :checked="form.huoniu"/>火{{ "\u3000" }}{{ "\u3000" }}牛:<input v-model="form.huoniu" class="topinp"> </view>
		<view class="toptd"><checkbox :checked="form.dianyuankaiguan"/>开关电源:<input v-model="form.dianyuankaiguan" class="topinp"> </view>
		<view class="toptd"><checkbox :checked="form.waizhidianyuan"/>外置电源:<input v-model="form.waizhidianyuan" class="topinp">V</view>
		<view class="toptd">
			<radio-group >
				<radio value="配" >配</radio>
				<radio value="不配" >不配</radio>
			</radio-group>
			适配器
		</view>
	  </view>
	  <view class="toptable">
		<view class="toptd"><checkbox :checked="form.chongdiandianyong"/>充电电容:<input v-model="form.chongdiandianyong" class="topinp"> </view>
		<view class="toptd"><checkbox :checked="form.edingdianya"/>额定电压:<input v-model="form.edingdianya" class="topinp"> </view>
		<view class="toptd"><checkbox :checked="form.guochongdianya"/>过充电压:<input v-model="form.guochongdianya" class="topinp"></view>
		<view class="toptd"><checkbox :checked="form.guofangdianya"/>过放电压:<input v-model="form.guofangdianya" class="topinp"></view>
	  </view>
	  <view style="display: flex;text-align: left;margin-left: 20px">
		<view class="toptd"><checkbox :checked="form.gongnen"/>功{{ "\u3000" }}{{ "\u3000" }}能:<input v-model="form.gongnen" class="topinp"> </view>
		<view class="toptd" style="margin-left: 30px"><checkbox :checked="form.dianchiyongliangpihao"/>电池容量/批号:<input v-model="form.dianchiyongliangpihao" class="topinp"> </view>
	  </view>
	</view>
	<view>
	  <h3 style="text-align: left">二、老化项目:</h3>
	  <view style="display: flex">
		<view style="margin-top: 10px;margin-left: 20px;">
		  老化方式：
		</view>
		<view class="toptable3">
		  <view class="toptd"><checkbox :checked="form.acgongnengs"/>AC功能:<input v-model="form.acgongnengs" class="topinp3">至<input v-model="form.acgongnenge" class="topinp3"></view>
		  <view class="toptd"><checkbox :checked="form.kaiguanshiyans"/>开关试验:<input v-model="form.kaiguanshiyans" class="topinp3">至<input v-model="form.kaiguanshiyane" class="topinp3"></view>
		  <view class="toptd"><checkbox :checked="form.laohuafangshiqita"/>其它<input v-model="form.laohuafangshiqita" class="topinp3">{{ "\u3000" }}<input v-model="form.laohuafangshiqitas" class="topinp3">至<input v-model="form.laohuafangshiqitae" class="topinp3"></view>
		</view>
	  </view>
	  <view style="display: flex">
		<view style="margin-top: 10px;margin-left: 20px;">
		  老化时间：
		</view>
		<view class="toptable3">
		  <view class="toptd"><checkbox :checked="form.zhaomings"/>照{{ "\u3000" }}明:<input v-model="form.zhaomings" class="topinp3">至<input v-model="form.zhaominge" class="topinp3"></view>
		  <view class="toptd"><checkbox :checked="form.shedengs"/>射{{ "\u3000" }}灯:<input v-model="form.shedengs" class="topinp3">至<input v-model="form.shedenge" class="topinp3"></view>
		  <view class="toptd"><checkbox :checked="form.gaofengs"/>高{{ "\u3000" }}风:<input v-model="form.gaofengs" class="topinp3">至<input v-model="form.gaofenge" class="topinp3"></view>
		  <view class="toptd"><checkbox :checked="form.difengs"/>低{{ "\u3000" }}风:<input v-model="form.difengs" class="topinp3">至<input v-model="form.difenge" class="topinp3"></view>
		  <view class="toptd"><checkbox :checked="form.laohuashijianqita"/>其它<input v-model="form.laohuashijianqita" class="topinp3">{{ "\u3000" }}<input v-model="form.laohuashijianqitas" class="topinp3">至<input v-model="form.laohuashijianqitae" class="topinp3"></view>
		</view>
	  </view>
	  <view style="display: flex">
		<view style="margin-top: 10px;margin-left: 20px;">
		  充电时间：
		</view>
		<view class="toptable3">
		  <view class="toptd"><input v-model="form.chongdianshijians" class="topinp3">至<input v-model="form.chongdianshijiane" class="topinp3"></view>
		</view>
	  </view>
	</view>
	<view>
	  <h3 style="text-align: left">三、巡查记录:</h3>
	  <table class="tablehistory">
		<tr>
		  <th class="first">
			<view style="text-align: right;">
			  检查项目
			</view>
			<view style="text-align: left;">
			  调整时间
			</view>
		  </th>
		  <th>
			老化电压（V）
		  </th>
		  <th>
			工作状态
		  </th>
		  <th>
			充电状态
		  </th>
		  <th>
			打开关状态
		  </th>
		  <th>
			收音状态
		  </th>
		  <th>
			其它
		  </th>
		</tr>
		<tr>
		  <td> <input v-model="form.xunjianshijian1" class="hisinput"> </td>
		  <td> <input v-model="form.laohuadainya1" class="hisinput"> </td>
		  <td> <input v-model="form.gongzuozhuantai1" class="hisinput"> </td>
		  <td> <input v-model="form.chongdianzhuangtai1" class="hisinput"> </td>
		  <td> <input v-model="form.dakaiguanzhuangtai1" class="hisinput"> </td>
		  <td> <input v-model="form.shouyinzhuangtai1" class="hisinput"> </td>
		  <td> <input v-model="form.qita1" class="hisinput"> </td>
		</tr>
		<tr>
		  <td> <input v-model="form.xunjianshijian2" class="hisinput"> </td>
		  <td> <input v-model="form.laohuadainya2" class="hisinput"> </td>
		  <td> <input v-model="form.gongzuozhuantai2" class="hisinput"> </td>
		  <td> <input v-model="form.chongdianzhuangtai2" class="hisinput"> </td>
		  <td> <input v-model="form.dakaiguanzhuangtai2" class="hisinput"> </td>
		  <td> <input v-model="form.shouyinzhuangtai2" class="hisinput"> </td>
		  <td> <input v-model="form.qita2" class="hisinput"> </td>
		</tr>
		<tr>
		  <td> <input v-model="form.xunjianshijian3" class="hisinput"> </td>
		  <td> <input v-model="form.laohuadainya3" class="hisinput"> </td>
		  <td> <input v-model="form.gongzuozhuantai3" class="hisinput"> </td>
		  <td> <input v-model="form.chongdianzhuangtai3" class="hisinput"> </td>
		  <td> <input v-model="form.dakaiguanzhuangtai3" class="hisinput"> </td>
		  <td> <input v-model="form.shouyinzhuangtai3" class="hisinput"> </td>
		  <td> <input v-model="form.qita3" class="hisinput"> </td>
		</tr>
	  </table>
	</view>
	<view>
	  <h3 style="text-align: left">四、常规功能测试:</h3>
	  <view style="margin-left: 10px">
		<view class="toptable3">
		  <view class="toptd">充满指示灯功能:<input v-model="form.chongdianzhishiv" class="topinp3">V<input v-model="form.chongdianzhishima" class="topinp3">mA</view>
		  <view class="toptd">USB输出:<input v-model="form.usbshuchuv" class="topinp3">V<input v-model="form.usbshuchuma" class="topinp3">mA</view>
		  <view class="toptd">自动转应急功能<input v-model="form.zidongzhuanyingji" class="topinp3">A</view>
		</view>
		<view class="toptable3">
		  <view class="toptd">调光功能:
			  <radio-group >
				<radio value="合格" >合格</radio>
				<radio value="不合格" >不合格</radio>
			  </radio-group>
		  </view>
		  <view class="toptd">充电灭灯功能:
			<radio-group >
				<radio value="合格" >合格</radio>
				<radio value="不合格" >不合格</radio>
			</radio-group>
		  </view>
		  <view class="toptd">内部工艺:
		  <radio-group >
				<radio value="合格" >合格</radio>
				<radio value="不合格" >不合格</radio>
			</radio-group>
		  </view>
		</view>
		<view style="width: 100%;display: flex;text-align: left;">
		  <view style="width: 50px">其它：</view><input v-model="form.changguiqita" class="btborder" style="width: 100%">
		</view>
	  </view>
	</view>
	<view>
	  <h3 style="text-align: left">五、数据测试记录:</h3>
	  <table class="tablehistory">
		<tr>
		  <th class="first" rowspan="2">
			<view style="text-align: right;">
			  检验项目
			</view>
			<view style="text-align: left;">
			  序号
			</view>
		  </th>
		  <th colspan="3">
			充电电流（mA）
		  </th>
		  <th rowspan="2">
			漏电流（mA）
		  </th>
		  <th colspan="8">
			工作电流（mA）
		  </th>
		</tr>
		<tr>
		  <th>
			  <view style="display: inline-flex;">
				  AC<input v-model="form.ac" class="acdc">V
			  </view>
		  </th>
		  <th>
			  <view style="display: inline-flex;">
				  DC<input v-model="form.dc" class="acdc">V
			  </view>
		  </th>
		  <th>
			太阳能
		  </th>
		  <th>
			高档
		  </th>
		  <th>
			中档
		  </th>
		  <th>
			低档
		  </th>
		  <th>
			照明/强
		  </th>
		  <th>
			照明/弱
		  </th>
		  <th>
			射灯/强
		  </th>
		  <th>
			射灯/弱
		  </th>
		  <th />
		</tr>
		<tr>
		  <td>标准值</td>
		  <td> <input v-model="form.ac0" class="dinput"> </td>
		  <td> <input v-model="form.dc0" class="dinput"> </td>
		  <td> <input v-model="form.taiyangneng0" class="dinput"> </td>
		  <td> <input v-model="form.loudianliu0" class="dinput"> </td>
		  <td> <input v-model="form.gaodang0" class="dinput"> </td>
		  <td> <input v-model="form.zhongdang0" class="dinput"> </td>
		  <td> <input v-model="form.didang0" class="dinput"> </td>
		  <td> <input v-model="form.zhaomingqiang0" class="dinput"> </td>
		  <td> <input v-model="form.zhongmingruo0" class="dinput"> </td>
		  <td> <input v-model="form.shedengqiang0" class="dinput"> </td>
		  <td> <input v-model="form.shedengruo0" class="dinput"> </td>
		  <td> <input v-model="form.kongbai0" class="dinput"> </td>
		</tr>
		<tr>
		  <td>1#</td>
		  <td> <input v-model="form.ac1" class="dinput"> </td>
		  <td> <input v-model="form.dc1" class="dinput"> </td>
		  <td> <input v-model="form.taiyangneng1" class="dinput"> </td>
		  <td> <input v-model="form.loudianliu1" class="dinput"> </td>
		  <td> <input v-model="form.gaodang1" class="dinput"> </td>
		  <td> <input v-model="form.zhongdang1" class="dinput"> </td>
		  <td> <input v-model="form.didang1" class="dinput"> </td>
		  <td> <input v-model="form.zhaomingqiang1" class="dinput"> </td>
		  <td> <input v-model="form.zhongmingruo1" class="dinput"> </td>
		  <td> <input v-model="form.shedengqiang1" class="dinput"> </td>
		  <td> <input v-model="form.shedengruo1" class="dinput"> </td>
		  <td> <input v-model="form.kongbai1" class="dinput"> </td>
		</tr>
		<tr>
		  <td>2#</td>
		  <td> <input v-model="form.ac2" class="dinput"> </td>
		  <td> <input v-model="form.dc2" class="dinput"> </td>
		  <td> <input v-model="form.taiyangneng2" class="dinput"> </td>
		  <td> <input v-model="form.loudianliu2" class="dinput"> </td>
		  <td> <input v-model="form.gaodang2" class="dinput"> </td>
		  <td> <input v-model="form.zhongdang2" class="dinput"> </td>
		  <td> <input v-model="form.didang2" class="dinput"> </td>
		  <td> <input v-model="form.zhaomingqiang2" class="dinput"> </td>
		  <td> <input v-model="form.zhongmingruo2" class="dinput"> </td>
		  <td> <input v-model="form.shedengqiang2" class="dinput"> </td>
		  <td> <input v-model="form.shedengruo2" class="dinput"> </td>
		  <td> <input v-model="form.kongbai2" class="dinput"> </td>
		</tr>
		<tr>
		  <td>3#</td>
		  <td> <input v-model="form.ac3" class="dinput"> </td>
		  <td> <input v-model="form.dc3" class="dinput"> </td>
		  <td> <input v-model="form.taiyangneng3" class="dinput"> </td>
		  <td> <input v-model="form.loudianliu3" class="dinput"> </td>
		  <td> <input v-model="form.gaodang3" class="dinput"> </td>
		  <td> <input v-model="form.zhongdang3" class="dinput"> </td>
		  <td> <input v-model="form.didang3" class="dinput"> </td>
		  <td> <input v-model="form.zhaomingqiang3" class="dinput"> </td>
		  <td> <input v-model="form.zhongmingruo3" class="dinput"> </td>
		  <td> <input v-model="form.shedengqiang3" class="dinput"> </td>
		  <td> <input v-model="form.shedengruo3" class="dinput"> </td>
		  <td> <input v-model="form.kongbai3" class="dinput"> </td>
		</tr>
		<tr>
		  <th class="first" rowspan="2">
			<view style="text-align: right;">
			  检验项目
			</view>
			<view style="text-align: left;">
			  序号
			</view>
		  </th>
		  <th colspan="3">
			转速（RPM）
		  </th>
		  <th rowspan="2">
			遥控距离（M）
		  </th>
		  <th colspan="6">
			工作时间（H）
		  </th>
		  <th colspan="2">
			其它
		  </th>
		</tr>
		<tr>
		  <th>
			高
		  </th>
		  <th>
			中
		  </th>
		  <th>
			低
		  </th>
		  <th>
			<input v-model="form.gongzuoh0" class="dinput">
		  </th>
		  <th>
			<input v-model="form.gongzuoh1" class="dinput">
		  </th>
		  <th>
			<input v-model="form.gongzuoh2" class="dinput">
		  </th>
		  <th>
			<input v-model="form.gongzuoh3" class="dinput">
		  </th>
		  <th>
			<input v-model="form.gongzuoh4" class="dinput">
		  </th>
		  <th>
			<input v-model="form.gongzuoh5" class="dinput">
		  </th>
		  <th>
			<input v-model="form.ceshiqita1" class="dinput">
		  </th>
		  <th>
			<input v-model="form.ceshiqita2" class="dinput">
		  </th>
		</tr>
		<tr>
		  <td>标准值</td>
		  <td> <input v-model="form.rpmgao0" class="dinput"> </td>
		  <td> <input v-model="form.rpmzhong0" class="dinput"> </td>
		  <td> <input v-model="form.rpmdi0" class="dinput"> </td>
		  <td> <input v-model="form.raokongjuli0" class="dinput"> </td>
		  <td> <input v-model="form.gongzuoh00" class="dinput"> </td>
		  <td> <input v-model="form.gongzuoh10" class="dinput"> </td>
		  <td> <input v-model="form.gongzuoh20" class="dinput"> </td>
		  <td> <input v-model="form.gongzuoh30" class="dinput"> </td>
		  <td> <input v-model="form.gongzuoh40" class="dinput"> </td>
		  <td> <input v-model="form.gongzuoh50" class="dinput"> </td>
		  <td> <input v-model="form.ceshiqita10" class="dinput"> </td>
		  <td> <input v-model="form.ceshiqita20" class="dinput"> </td>
		</tr>
		<tr>
		  <td>1#</td>
		  <td> <input v-model="form.rpmgao1" class="dinput"> </td>
		  <td> <input v-model="form.rpmzhong1" class="dinput"> </td>
		  <td> <input v-model="form.rpmdi1" class="dinput"> </td>
		  <td> <input v-model="form.raokongjuli1" class="dinput"> </td>
		  <td> <input v-model="form.gongzuoh01" class="dinput"> </td>
		  <td> <input v-model="form.gongzuoh11" class="dinput"> </td>
		  <td> <input v-model="form.gongzuoh21" class="dinput"> </td>
		  <td> <input v-model="form.gongzuoh31" class="dinput"> </td>
		  <td> <input v-model="form.gongzuoh41" class="dinput"> </td>
		  <td> <input v-model="form.gongzuoh51" class="dinput"> </td>
		  <td> <input v-model="form.ceshiqita11" class="dinput"> </td>
		  <td> <input v-model="form.ceshiqita21" class="dinput"> </td>
		</tr>
		<tr>
		  <td>2#</td>
		  <td> <input v-model="form.rpmgao2" class="dinput"> </td>
		  <td> <input v-model="form.rpmzhong2" class="dinput"> </td>
		  <td> <input v-model="form.rpmdi2" class="dinput"> </td>
		  <td> <input v-model="form.raokongjuli2" class="dinput"> </td>
		  <td> <input v-model="form.gongzuoh02" class="dinput"> </td>
		  <td> <input v-model="form.gongzuoh12" class="dinput"> </td>
		  <td> <input v-model="form.gongzuoh22" class="dinput"> </td>
		  <td> <input v-model="form.gongzuoh32" class="dinput"> </td>
		  <td> <input v-model="form.gongzuoh42" class="dinput"> </td>
		  <td> <input v-model="form.gongzuoh52" class="dinput"> </td>
		  <td> <input v-model="form.ceshiqita12" class="dinput"> </td>
		  <td> <input v-model="form.ceshiqita22" class="dinput"> </td>
		</tr>
		<tr>
		  <td>3#</td>
		  <td> <input v-model="form.rpmgao3" class="dinput"> </td>
		  <td> <input v-model="form.rpmzhong3" class="dinput"> </td>
		  <td> <input v-model="form.rpmdi3" class="dinput"> </td>
		  <td> <input v-model="form.raokongjuli3" class="dinput"> </td>
		  <td> <input v-model="form.gongzuoh03" class="dinput"> </td>
		  <td> <input v-model="form.gongzuoh13" class="dinput"> </td>
		  <td> <input v-model="form.gongzuoh23" class="dinput"> </td>
		  <td> <input v-model="form.gongzuoh33" class="dinput"> </td>
		  <td> <input v-model="form.gongzuoh43" class="dinput"> </td>
		  <td> <input v-model="form.gongzuoh53" class="dinput"> </td>
		  <td> <input v-model="form.ceshiqita13" class="dinput"> </td>
		  <td> <input v-model="form.ceshiqita23" class="dinput"> </td>
		</tr>
	  </table>
	</view>
	<view style="display: flex;justify-content: space-between;">
	  <view style="text-align: left">
		<view class="btview">落地测试：<input v-model="form.luodiceshi" class="btborder" style="width: 200px"></view>
		<view class="btview">高压测试:<input v-model="form.gaoyaceshiv" class="input50">V<input v-model="form.gaoyaceshima" class="input50">mA</view>
		<view class="btview">结果：A：<input v-model="form.jieguoa" class="input50"> B:<input v-model="form.jieguob" class="input50"> C:<input v-model="form.jieguoc" class="input50"></view>
	  </view>
	  <view style="text-align: right">
		<view class="btview">AQL值：
		  A：<select v-model="form.aqla" style="width: 60px">
			<option v-for="(item,index) in grades" :key="index" :value="item">{{ item }}</option>
		  </select>
		  B：<select v-model="form.aqlb" style="width: 60px">
			<option v-for="(item,index) in grades" :key="index" :value="item">{{ item }}</option>
		  </select>
		  C：<select v-model="form.aqlc" style="width: 60px">
			<option v-for="(item,index) in grades" :key="index" :value="item">{{ item }}</option>
		  </select>
		</view>
		<view class="btview">AC/RE：
		  A<input v-model="form.aca" class="input25">/<input v-model="form.rea" class="input25">
		  B:<input v-model="form.acb" class="input25">/<input v-model="form.reb" class="input25">
		  C:<input v-model="form.acc" class="input25">/<input v-model="form.rec" class="input25">
		</view>
	  </view>
	  
	</view>
  </view>
</view>
</template>

<script>
import selectBox from '../../components/select-box/select-box.vue'
	export default {
		components:{
			selectBox
		},
		onLoad(option) {
			if(option.id){
				this.getBill(option.id)
			}
		},
		created() {
		},
		data() {
			return {
				downtests: ['合格', '不合格', '不适用'],
				editVisible: false,
				form: {billtype:'',guochong:''},
				query: {
				pageIndex: 1,
				pageSize: 10,
				name: ''
				},
				page: [],
				grades: [0, 0.25, 0.4, 0.65, 1.0, 1.5, 2.5, 4.0, 6.5, 10, 15, 25],
				levels: ['S-1', 'S-2', 'S-3', 'S-4', 'I', 'II', 'III'],
				options: ['/', '√', '×'],
				datas: [],
				imageValue:[],
				open:false,
				index:0,
				quality:{aqla:''},
			}
		},
		methods: {
			billtypeChange($event){
				this.form.billtype = $event.target.value
			},
			getBill(id){
				this.$http.get(
					"u8QcProduce/get",
					{
						id:id
					}
				).then(res=>{
					const row = res.data.data.data
					this.form.cinvcode = row.cInvCode
					this.form.mdepcode = row.MDepCode
					this.form.mocode = row.MoCode
					this.form.moid = row.MoDId
					this.form.qty = row.Qty
					this.form.ccomunitname = row.cComUnitName
					this.form.cdepname = row.cDepName
					this.form.cinvname = row.cInvName
					this.form.cinvstd = row.cInvStd
					this.form.ddate = row.dDate
					this.form.socode = row.socode
					this.form.isosid = row.iSOsID
					this.form.csoinvname = row.csoinvname
					this.form.csocode = row.cSOCode
					this.$forceUpdate()
				})
			},
			bindPickerChange(){
				this.setQuality(this.datas[this.index])
			},
			radioChange(e){
				this.quality.measurement = e.detail.value
			},
			showDrawer(){
				this.$refs.drawer.open()
			},
			selbox(index,type){
				this.quality.entitys[index][type] =  this.quality.entitys[index][type] === '符合' ? '不符合' : '符合' 
			},
			selresult(index){
				this.quality.entitys[index].result =  this.quality.entitys[index].result === '合格' ? '不合格' : '合格'
				this.quality.entitys = JSON.parse(JSON.stringify(this.quality.entitys))
			},
			saveEdit() {
			  this.$http.post(
			  	"rpProduce/save",
			  	this.form
			  ).then(res=>{
				if(res.data.code === 200){
					uni.showToast({
					    title: res.data.message,
					    duration: 2000
					});
					setTimeout(()=>{
						uni.navigateBack()
					},2000)
				}else{
					uni.showToast({
						icon:'error',
					    title: res.data.message,
					    duration: 2000
					});
				}
			  })
			},
			  // 获取上传状态
			select(e){
				this.$http.upload(e.tempFilePaths[0]).then(res =>{
					console.log(res.data)
				})
			},
			// 获取上传进度
			progress(e){
				console.log('上传进度：',e)
			},

			// 上传成功
			success(e){
				console.log('上传成功')
			},
			// 上传失败
			fail(e){
				console.log('上传失败：',e)
			},
			changeAqla(e) {
				this.form.aqla = e
			  if (!this.form.level) {
				uni.showToast({
				    title: '请检测质检等级',
					icon:'error'
				});
				return
			  }
			  if (!this.form.qty) {
				uni.showToast({
				    title: '请先选择单据',
					icon:'error'
				});
				return
			  }
			  if (this.form.aqla === 0) {
				this.form.aca = 0
				this.form.rea = 1
			  } else {
				const data = { level: this.form.level, qty: this.form.qty, grade: this.form.aqla }
				this.$http.get(
					"qmilcode/get",
					data
				).then(res => {
				  this.form.aca = res.data.data.data.ac
				  this.form.rea = res.data.data.data.re
				  this.form = JSON.parse(JSON.stringify(this.form))
				})
			  }
			},
			changeAqlb(e) {
				this.form.aqlb = e
			  if (!this.form.level) {
				uni.showToast({
				    title: '请检测质检等级',
					icon:'error'
				});
				return
			  }
			  if (!this.form.qty) {
				uni.showToast({
				    title: '请先选择单据',
					icon:'error'
				});
				return
			  }
			  if (this.form.aqlb === 0) {
				this.form.acb = 0
				this.form.reb = 1
			  } else {
				const data = { level: this.form.level, qty: this.form.qty, grade: this.form.aqlb }
				this.$http.get(
					"qmilcode/get",
					data
				).then(res => {
				  this.form.acb = res.data.data.data.ac
				  this.form.reb = res.data.data.data.re
				  this.form = JSON.parse(JSON.stringify(this.form))
				})
			  }
			},
			changeAqlc(e) {
				this.form.aqlc = e
			  if (!this.form.level) {
				uni.showToast({
				    title: '请检测质检等级',
					icon:'error'
				});
				return
			  }
			  if (!this.form.qty) {
				 uni.showToast({
				     title: '请先选择单据',
					icon:'error'
				 });
				return
			  }
			  if (this.form.aqlc === 0) {
				this.form.acc = 0
				this.form.rec = 1
			  } else {
				const data = { level: this.form.level, qty: this.form.qty, grade: this.form.aqlc }
				this.$http.get(
					"qmilcode/get",
					data
				).then(res => {
				  this.form.acc = res.data.data.data.ac
				  this.form.rec = res.data.data.data.re
				  this.form = JSON.parse(JSON.stringify(this.form))
				})
			  }
			},
			changeLevel(e) {
				this.form.level = e
			  if (this.form.aqla) {
				this.changeAqla()
			  }
			  if (this.form.aqlb) {
				this.changeAqlb()
			  }
			  if (this.form.aqlc) {
				this.changeAqlc()
			  }
			}
		}
	}
</script>

<style lang="scss">
	.container {
		font-size: 12px;
		height: 100%;
		background-color: #f0faff;
	}
	 .cbody{
	    background-color: #fcfcfc;
	  }
	  input{
		  background-color: #dedede;
	  }
	  select{
	    -webkit-appearance:none;
	    -moz-appearance:none;
	    appearance:none;
	  }
	.content{
	  margin: 5px auto;
	  width: 900px;
	  padding: 20px;
	  font-size: 14px;
	  font-weight: 400;
	  background-color: #f7f7f7;
	  text-align: center;
	}
	.tablehistory{
	    width: 100%;
	  }
	.toptable{
		display: grid;
		grid-template-columns: 1fr 1fr 1fr 1fr;
		margin: 5px;
	  }
	.toptable3{
		text-align: left;
		display: grid;
		grid-template-columns: 1fr 1fr 1fr;
		margin: 5px 2px;
		}
	.topinp3{
		border-width: 0 0 1px 0;
		background-color: #f7f7f7 ;
		border-color: #000000;
		border-style: solid;
		width: 50px;
		}
	.toptd{
		display: flex;
		margin: 3px;
		}
	.topinp{
		text-align: left;
		border-width: 0 0 1rpx 0;
		background-color: #f7f7f7 ;
		border-color: #000000;
		border-style: solid;
		width: 100px;
		}
	.acdc{
		width: 30rpx;
		border-width: 0 0 1rpx 0;
		background-color: #f7f7f7 ;
		border-color: #000000;
		border-style: solid;
	}
	.hisinput{
		border-width: 0;
		width: 100%;
		background-color: #fafafa;
	}
	.dinput{
	  border-width: 0;
	  width: 100%;
	  background-color: #fafafa;
	}
	.first:before{
	    content: "";
	    position: absolute;
	    width: 1px;
	    height:100px;/* 需要手调 ，线的长度 */
	    background-color: black; /* 线的颜色 black */
	    display: block;
	    transform: rotate(-74deg);/* 需要手调 ，斜线的角度*/
	    transform-origin: top;;
	}
	.first{
	    width: 100px;
	}
	.input50{
	  border-width: 0 0 1px 0;
	  background-color: #f7f7f7 ;
	  border-color: #000000;
	  border-style: solid;
	  width: 100px;
	}
	.input25{
		border-width: 0 0 1px 0;
		background-color: #f7f7f7 ;
		border-color: #000000;
		border-style: solid;
		width: 35px;
	}
	.btborder{
	  border-width: 0 0 1px 0;
	  background-color: #f7f7f7 ;
	  border-color: #000000;
	  border-style: solid;
	}
	.btdiv{
	  margin: 3px;
	}
	.divborder{
	  padding: 5px;
	  border-width: thin;
	  border-color: #c7c7c7;
	  border-style: solid;
	}
	td{
		text-align: center;
		border-style: solid;
		border-width: thin;
		border-color: #c7c7c7;
	}
	th{
		border-style: solid;
		border-width: thin;
		font-weight: 400;
		border-color: #c7c7c7;
	}
	.btview{
		display: flex;
	}
	
</style>
